package com.yuxi.Config;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.web.context.support.WebApplicationContextUtils;

import com.sun.org.apache.xml.internal.resolver.helpers.PublicId;
import com.yuxi.Dao.InformationClassificationDao;
import com.yuxi.Dao.InformationSortDao;
import com.yuxi.Dao.InformationSourceDao;
import com.yuxi.Entity.InformationClassification;
import com.yuxi.Entity.InformationSort;
import com.yuxi.Entity.InformationSource;
import com.yuxi.Entity.PrisonStructure;
import com.yuxi.spring.jbpm.Util.SpringContextUtils;

public class ConfigStatic {
	
	public static boolean VerifyCodeOff=false;
	
	//信息分类表
	public static List<InformationSort> ifSort=null;
	//信息渠道
	//
	public static List<InformationSource> ifSource=null;
	//信息分级
	public static List<InformationClassification> ifCation=null;
	
	public static String LongTimeS="3502800000000";
	
	/**
	 * 获取信息分类表
	 * */
	public static List<InformationSort> getIfSort() {
		if(ifSort==null){
			InformationSortDao i=(InformationSortDao) SpringContextUtils.getBeanByClass(InformationSortDao.class); 
			ConfigStatic.ifSort=i.getAllInformationSort();
		}
		return ifSort;
	}
	/**
	 *信息分类表
	 * */
	public static void setIfSort(List<InformationSort> ifSort) {
		ConfigStatic.ifSort = ifSort;
	}
	/**
	 *信息渠道
	 * */
	public static List<InformationSource> getIfSource() {
		if(ifSource==null){
			InformationSourceDao i=(InformationSourceDao) SpringContextUtils.getBeanByClass(InformationSortDao.class); 
			ConfigStatic.ifSource=i.getAllInformationSource(); 
		}	
		return ifSource;
	}
	/**
	 *信息渠道
	 * */
	public static void setIfSource(List<InformationSource> ifSource) {
		
		ConfigStatic.ifSource = ifSource;
	}	
	/**
	 * 信息分级
	 * */
	public static List<InformationClassification> getIfCation() {
		if(ifCation==null){
			InformationClassificationDao i=(InformationClassificationDao) SpringContextUtils.getBeanByClass(InformationSortDao.class); 
			ConfigStatic.ifCation=i.getAllInformationClassification();
		}
		return ifCation;
	}
	/**
	 * 信息分级
	 * */
	public static void setIfCation(List<InformationClassification> ifCation) {
		ConfigStatic.ifCation = ifCation;
	}
	public static Map<String, Integer> DOTYPETABLE=new HashMap<String, Integer>();
	static{
		DOTYPETABLE.put("UserLogin", 1);
		DOTYPETABLE.put("UserAdd", 2);
		DOTYPETABLE.put("InformationAdd", 3);
		DOTYPETABLE.put("InformationDel", 4);
		DOTYPETABLE.put("InformationUpDate", 5);
		DOTYPETABLE.put("InformationSub", 6);
		DOTYPETABLE.put("InformationReturn", 7);//打回
		DOTYPETABLE.put("InformationDispatch", 8);//调妍
		DOTYPETABLE.put("InformationChangeToPrison", 9);//调妍
		DOTYPETABLE.put("InformationChangeToPrisonArea", 10);//调妍
		
	}
	
	public static  Map<String, Integer> FLOWTABLE=new HashMap<String, Integer>();
	static{
		FLOWTABLE.put("InputInfo", 0);
		FLOWTABLE.put("InfoManage", 1);
		FLOWTABLE.put("FirstCheck", 2);
		FLOWTABLE.put("ReCheck", 3);
		FLOWTABLE.put("Check", 4);
		FLOWTABLE.put("InfoResearch", 5);
		FLOWTABLE.put("TaskDispatch", 6);
		FLOWTABLE.put("CurTaskDispatch", 7);
		FLOWTABLE.put("TaskFinish", 8);
		FLOWTABLE.put("InfoComment", 9);
		FLOWTABLE.put("InfoEvaluation", 10);
		FLOWTABLE.put("InfoFinish", 11);
	}
	
	public static  Map<String, String> FLOWTABLEID=new HashMap<String, String>();
	static{
		FLOWTABLEID.put("0", "信息录入");
		FLOWTABLEID.put("1", "信息管理");
		FLOWTABLEID.put("2", "初审");
		FLOWTABLEID.put("3", "复核");
		FLOWTABLEID.put("4", "审核");
		FLOWTABLEID.put("5", "信息研判");
		FLOWTABLEID.put("6", "任务派遣");
		FLOWTABLEID.put("7", "即时任务派遣");		
	}
	
	public static  Map<String, Integer> STUCTURETABLE=new HashMap<String, Integer>();
	static{
		STUCTURETABLE.put("Prison",0);//监狱
		STUCTURETABLE.put("Department", 1);//科室		
		STUCTURETABLE.put("PrisonArea", 0);//监区
		STUCTURETABLE.put("Mouth", 1);//分口
		STUCTURETABLE.put("ChildPrisonArea", 2);//分监区	
	}
	
	public static  Map<String, Integer> TASKTYPETABLE=new HashMap<String, Integer>();
	static{
		TASKTYPETABLE.put("Task", 0);//任务
		TASKTYPETABLE.put("CurTask", 1);//即时任务		
	}
	
	public static  Map<String, Integer> INFOTYPE=new HashMap<String, Integer>();
	static{
		INFOTYPE.put("prison",0);//任务
		INFOTYPE.put("prisonArea",1);//(0：监狱，1：监区)
	} 
	
	
	
}
